package com.yuhanginfo.common.utils;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ReadProperties {
	private ReadProperties(){}
	private static Logger logger = LoggerFactory.getLogger(ReadProperties.class);
	private static Properties properties;
	static {
		properties = new Properties();
		ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
		InputStream input =  classLoader.getResourceAsStream("jpWeb.properties");
		try {
			properties.load(input);
		} catch (IOException e) {
			logger.debug(e.getMessage(),e);
		}
	}
	
	public static String ReadByName(String name){
		if(properties == null){
		    return null;
		}
		return properties.getProperty(name);
	}
}
